package jp.com.nobnak.commentviewer.live;

import jp.com.nobnak.commentviewer.common.IAction1;
import jp.com.nobnak.commentviewer.net.AsyncRequestException;


public class ErrorHandler implements IAction1<AsyncRequestException> {
	private Iterable<IAction1<IError>> mIterable;
	
	public ErrorHandler(Iterable<IAction1<IError>> iterable) {
		mIterable = iterable;
	}
	
	@Override
	public void call(AsyncRequestException param1) {
		final AsyncRequestException mException = param1;
		IError error = new IError() {
			@Override
			public String getMessage() {
				return mException.getMessage();
			}
		};
		for (IAction1<IError> listener : mIterable)
			listener.call(error);
	}
}
